
var http = require('http');
var router = require('./module/router.js');

// 创建服务器
var server = createServer(function(req, res){
	// 跳过了 chrome 的收藏图标的请求
	if (req.url == './favicon.ico') return;

	if (req.url == '/') {
		router.showIndex(req, res);
	} else if (req.url.substr(0,5) == '/stu/'){
		router.showStu(req, res);
	} else {
		router.show404(req, res);
	}

});

// 运行服务器
server.listen(3000, '127.0.0.1');